﻿namespace BackEnd
{
    public class ApiResult
    {
        public int Code { get; set; }
        public string Msg { get; set; }
        public object Data { get; set; }
        public static ApiResult DefaultSuccess => new ApiResult { Code = 1, Msg = "ok", Data = null};
        public static ApiResult Success(object data) => new ApiResult {Code = 1, Msg = "ok", Data = data};
        public static ApiResult Failed(string msg) => new ApiResult {Code = 0, Msg = msg, Data = null};
    }
}